package com.cal.utms.action.maintenance;

import com.cal.utms.dao.maintenance.IssuerDaoImpl;
import com.cal.utms.dto.maintenance.CreditRatingDto;
import com.cal.utms.model.maintenance.IssuerModel;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class CreditRationAction extends ActionSupport implements ModelDriven<CreditRatingDto> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private CreditRatingDto creditRatingDto = new CreditRatingDto();
	IssuerDaoImpl daoImpl = new IssuerDaoImpl();
	private boolean success;

	public String getAllCreditRating() {
		success = true;
		creditRatingDto.setCreditRatingDtos(IssuerModel.createCreditRateList(daoImpl.getAllCreditRating()));
		return Action.SUCCESS;
	}

	@Override
	public CreditRatingDto getModel() {
		return creditRatingDto;
	}

	public CreditRatingDto getCreditRatingDto() {
		return creditRatingDto;
	}

	public void setCreditRatingDto(CreditRatingDto creditRatingDto) {
		this.creditRatingDto = creditRatingDto;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

}
